home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48hor2
/
fullpath.doc
< prev
next >
Wrap
Text File
|
1995-03-31
|
4KB
|
117 lines
[Note: The following is a good example of how folks use the "comp.sys.hp48"
newsgroup on USENET to get answers to tough questions. -jkh-]
(Comp.sys.hp48)
Item: 433 by clemon@lemsys.UUCP
Author: [Craig Lemon]
Subj: Referencing Vars by FULL PATHS
Date: Mon Dec 30 1991
Is there any way to specify a FULL PATH to a variable when you want
to execute it (without changing to that path). For instance, QUD in in {
HOME UTIL MISC }, { HOME UTIL MISC QUD } doesn't call the program, what
will? I would like to use this with some applications where I would like to
write to a variable given full path or possibly run a sub-program in some
other path.
----------
Resp: 2 of 5 by vsteiger@ubevax.unibe.ch
Date: Tue Dec 31 1991
I was unable to find the answer in the manual in less than a minute, so
here it is from memory. (Otherwise you would have gotten a sarcastic remark
and a page number in the manual...)
The answer is yes:
(1) Try: { HOME ASTRO KEPLER } EVAL
This changes to the path { HOME ASTRO } and evaluates the program KEPLER.
(Not exactly what you were asking, I know.)
(2) Try: { HOME ASTRO KEPLER } RCL EVAL
This recalls the program KEPLER to the stack *without* changing to
{ HOME ASTRO }, then evaluates it. Of course, KEPLER must not call
subroutines in { HOME ASTRO } or anywhere off the current path, unless
by the very same procedure.
Hope that helps.
Ruedi
Internet: vsteiger@phim.unibe.ch
----------
Resp: 3 of 5 by bbwwbb@mixcom.COM
Author: [Kevin Jessup]
Date: Tue Dec 31 1991
I wrote a little program called EVPATH (EValuate PATH) to take me to a
directory, EVALuate a program (run it) and return me to where I was.
The requirements are that I should also be able to pass any parameters
to the program being called as if I were in that program's directory.
This is EVPATH. Put it in your HOME directory.
\<< PATH DEPTH ROLLD HOME EVAL DEPTH ROLL EVAL \>>
The input to this program (on stack level one) is a list containing the
full path to the program from the HOME directory.
I use QED (a fast machine-code editor) often. The code is off in its
own directory. To access it, I pass its path to the above program from
a key assignment or custom menu.
Example:
Say I want to run the program QED.o in the QED directory at any time from
a key. I have the above program in the HOME directory with a name of
EVPATH. I then assign the following program directly to a key.
\<< {QED QED.o} EVPATH \>>
That's it! Now, whenever I press that key, QED.o runs and edits the
object on the stack. When I exit QED.o, EVPATH returns me to where I
was when I pressed the key with the above key assignment.
Hope this helps. Then again, I would not at all be surprised if there is
an entirely better and more efficient way to accomplish the whole process!
-- Kevin Jessup, bbwwbb@mixcom.mixcom.com
----------
Resp: 4 of 5 by pfleury@disuns2.epfl.ch
Author: [Pascal Fleury]
Date: Fri Jan 10 1992 10:53
Lines: 30
Yes. Save current path and go there, to program path. Execute the program,
with all its environment variables. Then return to old path.
example:
PATH -> P << { HOME UTIL MISC QUD } EVAL P EVAL >>
You could write a small program in the root directory, to eval your program
and keeping the old path.
%%HP: ...
@ Execute distant program
EXEC
\<< PATH \->P
\<< EVAL P EVAL
\>>
\>>
Regards, Pascal Fleury
pfleury@disuns2.epfl.ch
----------
Resp: 5 of 5 by djf@css.itd.umich.edu
Author: [David J. Fred]
Date: Wed Jan 15 1992 13:03
Lines: 25
Alternatively, one could write:
\<< PATH + EVAL \>>
"Just another RPL hacker." ;->>
--
David Fred djf@css.itd.umich.edu
University of Michigan
ITD/CSS UNIX Support +1 313 763-0484